package cn.com.dstz.data.post;

import java.util.Map;

/**
 * 喊单发送
 * 接收参数:
 * 
 * @author 叶装装
 *
 */
public class TradeKeyVal extends PostKeyVal{
	
	private Map< String, Object > data;
	
	/**
	 * 接收下单的参数
	 */
	public TradeKeyVal( Map< String, Object > data ){
		super( );
		this.data = data;
	}
	
	@Override
	public String processValue( ) {
		if( this.data == null ){
			return "Trade Data Is Empty";
		}
		StringBuffer buffer = new StringBuffer( );
		this.appendToBufferWithDefaultSep( buffer, data.get( "key" ), true );
		this.appendToBufferWithDefaultSep( buffer, data.get( "topaid" ), true );
		this.appendToBufferWithAtSep( buffer, data.get( "usertype" ), true );
		this.appendToBufferWithAtSep( buffer, data.get( "name" ), true );
		this.appendToBufferWithAtSep( buffer, data.get( "direction" ), true );
		this.appendToBufferWithAtSep( buffer, data.get( "openposition" ), true );
		this.appendToBufferWithAtSep( buffer, data.get( "stopposition" ), true );
		this.appendToBufferWithAtSep( buffer, data.get( "longposition" ), true );
		this.appendToBufferWithAtSep( buffer, data.get( "closeposition" ), true );
		this.appendToBufferWithAtSep( buffer, data.get( "profit" ), true );
		this.appendToBufferWithAtSep( buffer, data.get( "starttime" ), true );
		this.appendToBufferWithAtSep( buffer, data.get( "endtime" ), true );
		this.appendToBufferWithAtSep( buffer, data.get( "reason" ), true );
		this.appendToBufferWithAtSep( buffer, data.get( "adminname" ), false );
		
		return buffer.toString( );
	}
	
}
